﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views {
    import flash.display.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;
    import net.wooga.pets.utils.*;

    public class FrontBubbleMediator extends Mediator {

        override public function onRegister():void{
            super.onRegister();
            addContextListener(EventConstants.SHOW_FRONT_BUBBLE, this.onShowBubble);
            addContextListener(EventConstants.HIDE_FRONT_BUBBLE, this.onHideBubble);
            this.view.mouseEnabled = (this.view.mouseChildren = false);
        }
        private function get view():FrontBubbleView{
            return ((viewComponent as FrontBubbleView));
        }
        private function onShowBubble(_arg1:InfoEvent):void{
            log("on show bubble");
            this.onHideBubble(_arg1);
            var _local2:DisplayObject = DisplayObject(_arg1.info);
            _local2.name = _arg1.id;
            this.view.addChild(_local2);
        }
        private function onHideBubble(_arg1:InfoEvent):void{
            Displays.removeChildByName(this.view, _arg1.id);
        }

    }
}//package net.wooga.pets.views 
